package com.wzxl.config.listener;

import com.wzxl.config.web.Servlets;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;

import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpServletRequest;

/**
 * @author rxbyes
 * @version V1.0
 * @package com.wzxl.config.listener
 * @description: TODO (监听器)
 * @date 2017-11-下午5:24
 */
@Configuration
public class WebContextListener extends RequestContextListener {

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {

        super.requestInitialized(servletRequestEvent);

        Servlets.request = (HttpServletRequest) servletRequestEvent.getServletRequest();
//        SpringContextHolder.applicationContext = (ApplicationContext) servletRequestEvent.getServletContext();
    }
}
